﻿<script type="text/javascript">

    $(function () {

        $("#in, #out").datepicker({
            dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
            dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'],
            dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
            monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
            changeMonth: true,
            changeYear: true,
            dateFormat: "dd/mm/yy"
        });
    });
</script>
@{
    List<SelectListItem> elstatus = new List<SelectListItem>();

    elstatus.Add(new SelectListItem() { Text = "0", Value = "Borrador" });
    elstatus.Add(new SelectListItem() { Text = "1", Value = "Plantilla" });
    elstatus.Add(new SelectListItem() { Text = "2", Value = "Enviado" });
    elstatus.Add(new SelectListItem() { Text = "3", Value = "Rechazado" });
    elstatus.Add(new SelectListItem() { Text = "4", Value = "Aprobado" });
}
<div id="cotfiltros">
    @if (((String)Session["accion"] == "asesores"))
    {

        using (Html.BeginForm("filtrarFechas", "Administracion", FormMethod.Post))
        { 
        <table>
            <tr>
                <th>
                    Fechas
                </th>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                Del:
                            </td>
                            <td>@Html.Editor("in")
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Al:
                            </td>
                            <td>@Html.Editor("out")
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <ul style="list-style-type: none;">
                                    <li>@Html.RadioButton("opcion", "emision") Emisión </li>
                                    <li>
                                        @Html.RadioButton("opcion", "rangocotizacion") In/Out </li>
                                </ul>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" value="Filtrar" />
                </td>
            </tr>
        </table>

        }

    }
    @if (((String)Session["accion"] == "ReporteAsesor"))
    {

        using (Ajax.BeginForm("filtrarAsesor", "Administracion", new AjaxOptions { UpdateTargetId = "refresh_asesor" }))
        { 
        <table>
            <tr>
                <th>
                    Fechas
                </th>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                Del:
                            </td>
                            <td>@Html.Editor("in")
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Al:
                            </td>
                            <td>@Html.Editor("out")
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <ul style="list-style-type: none;">
                                    <li>@Html.RadioButton("opcion", "emision") Emisión </li>
                                    <li>
                                        @Html.RadioButton("opcion", "rangocotizacion") In/Out </li>
                                </ul>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="idasesor" value="@Session["idAsesor"]" />
                    <input type="submit" value="Filtrar" />
                </td>
            </tr>
        </table>

        }

    }
    @if ((String)Session["accion"] == "Plantillas")
    {
        using (Html.BeginForm("FiltrarId", "Administracion", FormMethod.Post))
        {
        <table>
            <tr>
                <th>
                    Id:
                </th>
                <th>
                </th>
            </tr>
            <tr>
                <td>
                    <input type="text" name="id" size="4" />
                </td>
                <td>
                    <input type="submit" value="Filtrar" />
                </td>
            </tr>
        </table>
        }

        using (Html.BeginForm("filtrarPlantillas", "Administracion", FormMethod.Post))
        { 
        <table>
            <tr>
                <th>
                    Destinos
                </th>
                <th>
                    Temporadas
                </th>
                <!--
                <th>
                    Título
                </th>
                -->
            </tr>
            <tr>
                <td>
                    @Html.DropDownList("destino", new SelectList(ViewBag.destinos, "Id", "nombre_destino"))
                </td>
                <td>
                    @Html.DropDownList("temporada", new SelectList(ViewBag.temporadas, "Id", "nombre_temporada"))
                </td>
                <!--
                <td>
                    @Html.Editor("titulo")
                </td>
                -->
            </tr>
            <tr>
                <td>
                    <input type="submit" value="Filtrar" />
                </td>
            </tr>
        </table>

        }

        using (Html.BeginForm("filtrartitulo", "Administracion", FormMethod.Post))
        {
        <table>
            <tr>
                <th>
                    Título
                </th>
            </tr>
            <tr>
                <td>
                    @Html.Editor("titulo")
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" value="Filtrar por Título" />
                </td>
            </tr>
        </table>
        
        }

    }
    else if ((String)Session["accion"] == "Cotizaciones")
    {

        using (Html.BeginForm("FiltrarId", "Administracion", FormMethod.Post))
        {
        <table>
            <tr>
                <th>
                    Id:
                </th>
                <th>
                </th>
            </tr>
            <tr>
                <td>
                    <input type="text" name="id" size="4" />
                </td>
                <td>
                    <input type="submit" value="Filtrar" />
                </td>
            </tr>
        </table>
        }

        using (Html.BeginForm("filtrarCotizaciones", "Administracion", FormMethod.Post))
        { 
        <table>
            <tr>
                <th>
                    Asesores
                </th>
                <th>
                    Título
                </th>
                <th>
                    Fechas
                </th>
                <th>
                    Status
                </th>
            </tr>
            <tr>
                <td>
                    @Html.DropDownList("asesores", new SelectList(ViewBag.asesores, "cod_usuario", "nombre"))
                </td>
                <td>
                    @Html.Editor("titulo")
                </td>
                <td>
                    <table>
                        <tr>
                            <td>
                                Del:
                            </td>
                            <td>@Html.Editor("in")
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Al:
                            </td>
                            <td>@Html.Editor("out")
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <ul style="list-style-type: none;">
                                    <li>@Html.RadioButton("opcion", "emision") Emisión </li>
                                    <li>
                                        @Html.RadioButton("opcion", "rangocotizacion") In/Out </li>
                                </ul>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    @Html.DropDownList("status", new SelectList(elstatus, "Text", "Value"))
                </td>
            </tr>
            <tr>
                <td>
                    <input type="submit" value="Filtrar" />
                </td>
            </tr>
        </table>

        }

    }
</div>
